package com.kunchi.wms.stock.api;

import com.kunchi.isb.base.exception.ISBException;
import com.kunchi.isb.base.result.ISBResult;
import com.kunchi.isb.service.ISBPlainParamService;
import com.kunchi.wms.stock.po.Stock;
import com.kunchi.wms.stock.service.StockService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(value = "库存", tags = {"stockAdd"},description = "新增库存信息")
@RestController
@RequestMapping("/wms/stockAdd")
public class StockAddApi extends ISBPlainParamService<Stock, Stock> {

    @Autowired
    StockService stockService;
    @Override
    protected ISBResult<Stock> doService(ISBResult<Stock> isbResult, Stock stock) throws ISBException {
        isbResult.setBody(stockService.add(stock));
        return isbResult;
    }
}
